'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 推送
 * @author sundbcn@gmail.com (sun debing)
 */

var eventType = require('../consts/eventType');
var channelUtil = require('../util/channelUtil');
var mgrUtil = require('../util/mgrUtil');
var channelUtil = require('../util/channelUtil.js');

/**
 * 发送用户军团发生修改消息(多个)
 */
exports.sendUnionGroupChangedMulti = function (union_id, params, cb) {
    // console.log('多推送/*/*/*/*/*------params--------/*/*/*/*/*', union_id);
    // console.log('params:', params);
    mgrUtil.sendGlobalMessage(
        eventType.ON_UNION_GROUP_CHANGE,
        params,
        union_id,
        cb
    );
};

/**
 * 发送用户军团发生修改消息(单个)
 */
exports.sendUnionGroupChanged = function (role_id, params, cb) {
    // console.log('单个推送/*/*/*/*/*/*/*/*/*/*', role_id);
    mgrUtil.sendStatusMessage(
        [role_id],
        eventType.ON_UNION_GROUP_CHANGE,
        params,
        cb
    );
};

/**
 * 联盟帮助推送(多个)
 */
exports.sendUnioHelpChangedMulti = function (union_id, params, cb) {
    // console.log('多推送/*/*/*/*/*------params--------/*/*/*/*/*', union_id);
    // console.log('params:', params);
    mgrUtil.sendGlobalMessage(
        eventType.ON_UNION_HELP_CHANGE,
        params,
        union_id,
        cb
    );
};

/**
 * 发送用户军团发生修改消息(单个)
 */
exports.sendUnionHelpChangedOnly = function (role_id, params, cb) {
    // console.log('单个推送/*/*/*/*/*/*/*/*/*/*', role_id);
    mgrUtil.sendStatusMessage(
        [role_id],
        eventType.ON_UNION_HELP_CHANGE,
        params,
        cb
    );
};
